import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @Description TODO
 * @Author hhy
 * @Date 2020/10/20 19:36
 */
public class Test01 {
    public static void main(String[] args) throws IOException {
        Workbook workbook = new HSSFWorkbook();

        Sheet sheet = workbook.createSheet("第一个表");

        Row row = sheet.createRow(0);

        row.createCell(0).setCellValue("这个是第一个格子");

        try(FileOutputStream fos = new FileOutputStream("test.xls")){
            workbook.write(fos);
        }

    }
}
